<template>
  <div>
      <van-field label="名称" v-model="name"/>
      <van-field label="数量" v-model="num"/>
      <van-field label="积分" v-model="d_integral"/>
      <button @click="add">添加</button>
  </div>
</template>

<script>
import axios from '../../http/axios'
export default {
data () {
    return {
        name:'',
        num:'',
        d_integral:''
    }
},
methods: {
    add(){
        axios('/gift','post',{'name':this.name,'num':this.num,'d_integral':this.d_integral}).then(res=>{
            console.log(res)
            if (res.code==200){
                alert(res.msg)
            }
        })
    }
},
mounted () {
    
}
}
</script>

<style>

</style>